
public class SelectionSort {
	public static void main(String[] args) {
		int[] x= new int[6];
		x[0] = 3;
		x[1] = 5;
		x[2] = 2;
		x[3] = 7;
		x[4] = 9;
		x[5] = 1;
		
		sort(x);
	}
	
	public static void sort(int[] x){
		int count = 0;
		int num1;
		int num2;
		int y;
		
		int small;
		while(count <= x.length){
			if(x[count] < x[count+1]){
				small = x[count];
				y = x[0];
				x[0] = small;
				x[count] = y;
				count++;
			}
		}
		
		count = 0;
		y = 0;
		while(count <= x.length){
			num1 = x[count];
			num2 = x[count+1];
			if(num1 > num2){
				y = num2;
				num2 = num1;
				num1 = y;
				count++;
			}
			else{
				
			}
		}
		for(int i=0; i<x.length; i++){
			System.out.println(x[i]);
		}
	}

}
